import axios from './config.js'

//请求接口
export const logins = (username,password) =>axios.post('/users/login',{
    username,
    password
})

//获取验证码
export const getCaptcha = () =>axios.get('/users/getCaptcha')

//刷新验证码
export const refreshCaptcha = () =>axios.get('/users/refreshCaptcha')

//校验验证码
export const verifyCaptcha = (captcha="") =>axios.get('/users/verifyCaptcha',{
    params: {
        captcha
    }
})

//获取登入日志
export const getLoginlog = (page=1,count=20) =>axios.get('/getloginlog',{
    params: {
        page,
        count
    }
})

//微信登入接口
export const erwei = (wechatCode) =>axios.get('/users/wechatLogin',{
    params: {
        wechatCode
    }
})

//获取二维码地址
export const erweiUrl = (sid) =>axios.get('/users/getQrcode',{
    params: {
        sid
    }
})

//获取权限菜单
export const getMenulist = () =>axios.get('/permission/getMenuList')

//获取学员项目信息
export const getStulist = (page=1,count=10,classes='') =>axios.get('/students/getstulist',{
    params: {
        page,
        count,
        class: classes
    }
})

//添加学员信息
export const addStulist = data =>axios.post('/students/addstu',data)

//编辑学员信息
export const eduit = data =>axios.post('/students/updatestu',data)

//删除学员信息
export const delStu = sId =>axios.get('/students/delstu',{
    params:{
        sId
    }
})

//获取班级
export const getClass = () =>axios.get('/students/getclasses')

//获取订单
export const order = (order_id) =>axios.post('/order/get_order',order_id)

//vip产品
export const vipProduct = category_id =>axios.get('/product/get_product',{
    params:{
        category_id
    }
})

//预支付订单
export const preOrder = (product_id,quantity) =>axios.post('/order/pre_order',{
        product_id,
        quantity
    
})

//查询订单详情
export const getOrderdetail = order_id =>axios.post('/order/get_order',{
    order_id
})

//发起支付
export const commitOrder = order_id =>axios.post('/pay/payment',{
    order_id
})

//查询支付状态
export const queryPayresult = order_id =>axios.get('/order/query_order_status',{
    params:{
        order_id
    }
})

//获取所有用户信息
export const allUsermsg = () =>axios.get('/users/getAllUsers')